import collections
class Solution(object):
    def shortestCompletingWord(self, licensePlate, words):
        """
        :type licensePlate: str
        :type words: List[str]
        :rtype: str
        """
        licensePlate = licensePlate.lower()
        c = collections.Counter(licensePlate)
        min_len = float('inf')
        for word in words:
            flag = True
            t = collections.Counter(word)
            for key in c:
                if 'a' <= key <= 'z':
                    if t[key] < c[key]:
                        flag = False
                        break
            if flag:
                if len(word) < min_len:
                    out_word = word
                    min_len = len(word)
        return out_word
